home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / vedt.zip / DEMO9.VDM < prev    next >
Text File  |  1990-05-18  |  3KB  |  93 lines

  1. RI(9)/VEDIT and VEDIT PLUS - Multiple File Processing/
  2. M(H)            !Display header
  3.  
  4. YT/
  5. You often need to perform the same editing operation on a whole group of
  6. files.  For example, you might want to see which files contain a particular
  7. word (such as a program variable name).  Or you might discover that you have
  8. consistently misspelled the same word in twenty files.  Or you might want to
  9. print an entire group of files.
  10.  
  11. These and similar operation are easily performed in VEDIT and VEDIT PLUS using
  12. the supplied macro "WILDFILE.VDM".  As its name implies, the group of files
  13. may either be specified individually or using the wildcards "*" and "?".
  14.  
  15. This demo will first have you search for all occurrences of a word in all the
  16. text files on this demo disk.  It will then have you display the beginning
  17. of each text file.
  18.  
  19. /
  20.  
  21. M(K)
  22.  
  23. YWI YWB(1) 8
  24. Q26YEA            !Set editing attribute
  25. YWS(1) Q27YEA        !Set attribute in lower window "1"
  26. B #K            !Empty edit buffer
  27. +RL(P) wildfile.vdm    !Load macro
  28.  
  29. EE(1)
  30. B #K
  31. I\To search through all text files enter "*.TXT" for the first prompt, and
  32. press <Enter> twice.  At the "Execute..." prompt press "S".  At the search
  33. prompt type "programs" and press <Enter>.
  34.  
  35. At the "Display line..." prompt press "V" to enter editing mode.
  36. Alternatively, you could just display the line.
  37.  
  38. Press <Enter> to start.  \
  39.  
  40. B -V            !Display instructions
  41.  
  42. EE(Y) EQY        !Convert edit buffer Y back to text register
  43. EE(@)            !Back to main text
  44. YWS(@)            !Let WILDFILE run in default window
  45.  
  46. M(P)            !Execute the macro
  47.  
  48. YWI YWB(1) 8
  49. Q26YEA            !Set editing attribute
  50. YWS(1) Q27YEA        !Set attribute in lower window "1"
  51. EE(1)
  52. B #K
  53. I/To display the beginning of the text files enter "*.TXT" for the first
  54. prompt, and press <Enter> twice.  At the "Execute..." prompt press "C" to
  55. execute a command.  At the command prompt enter:
  56.  
  57.     11T
  58.  
  59. This will display the first 11 lines in each file.  At the next prompt
  60. press "Y" to pause the screen display after each file. /
  61.  
  62. B-V
  63.  
  64. EE(@)            !Back to main text
  65. YWS@            !Let WILDFILE run in default window
  66. M(P)
  67.  
  68. RI(9)/VEDIT PLUS - Multiple File Processing/
  69. M(H)
  70.  
  71. YT\
  72. Obviously, many other useful operations can be performed using the WILDFILE
  73. macro.  (It is more flexible than the similar UNIX "grep" function.)
  74.  
  75. Although outside the scope of this demo, you could create a file containing
  76. numerous search and replace commands.  The WILDFILE macro could then
  77. automatically perform the entire list of search and replace operations on an
  78. entire group of files.
  79.  
  80. After finishing this demo you might want to try the WILDFILE macro on your own 
  81. text or program files.  As long as you don't attempt to modify the files, the 
  82. demo VEDIT can search for text in files of up to 60K in length.  Try it to see 
  83. how fast VEDIT can search!  (VEDIT is the fastest editor available for 
  84. performing search/replace in multi-megabyte files.)
  85.  
  86. You can invoke WILDFILE directly using the supplied batch file "WILDFILE.BAT".
  87. Simply give the DOS command:
  88.  
  89.     WILDFILE
  90. \
  91.  
  92. M(K)
  93.